const app = getApp()
const $api = require('../../utils/api.js').API;
var WxParse = require('../../wxParse/wxParse.js');
Page({
    data: {
        info:{},
        imgUrl:app.globalData.imgUrl
    },
    onLoad: function(e){
      this.getCourse(e.id)
    },
    getCourse:function(id){
      var data = {'id':id}
      var that = this
      $api.get('course/info',data).then(res => {
        //请求成功
        if(res.data.code == 1){
          if(res.data.data.content1){
            console.log(1111)
            var article = res.data.data.content1;
            WxParse.wxParse('article', 'html', article,that, 5,that.data.imgUrl);
          }
          that.setData({
            info:res.data.data
          })
        }
    }).catch(err => {
        //请求失败
        //console.log('error','请求失败');
    })
    },
    onShareAppMessage: function() {
      return {
          title: "天意美业直通车",
          path: "/pages/index/index?puid="+wx.getStorageSync('uid')
      };
    }
});